package com.huang.mylibrary.runDao;


import org.greenrobot.greendao.generator.DaoGenerator;
import org.greenrobot.greendao.generator.Entity;
import org.greenrobot.greendao.generator.Schema;

import java.io.IOException;

public class MyDao {

    public static void main(String[] args) throws Exception {
        Schema schema = new Schema(1, "com.huang.mylibrary.bean");
        schema.setDefaultJavaPackageDao("com.huang.mylibrary.dao");
        initNetDao(schema);
        initUserList(schema);
        new DaoGenerator().generateAll(schema,"greendao/src/main/java");

    }


    private static void initNetDao(Schema schema) {
        Entity game = schema.addEntity("UserInfo");
        game.addIdProperty().autoincrement().notNull().unique().primaryKey();
        game.addStringProperty("url");
        game.addStringProperty("name");
        game.addLongProperty("peopleId");
    }


    private static void initUserList(Schema schema) {
        Entity game = schema.addEntity("ImageListInfo");
        game.addIdProperty().autoincrement().notNull().unique().primaryKey();
        game.addStringProperty("url");
        game.addLongProperty("peopleId");
    }
}
